package com.fastloan.mgt.jx.service;

import com.fastloan.common.model.CheckResult;
import com.fastloan.mgt.application.base.model.ApplicationVo;
import com.fastloan.mgt.customer.model.CustomerCredit;
import com.fastloan.mgt.jx.model.dto.*;
import com.fastloan.mgt.jx.model.vo.JxModelResultVO;
import com.fastloan.mgt.product.basics.model.Product;
import com.kawins.base.BaseService;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;

/**
 * @author chenkai
 * createTime 2018-01-2018/1/5 9:48
 */
public interface JxService extends BaseService<JxCreditDTO> {
    /**
     * 预授信请求信息接口
     *
     * @param jxCreditDTO
     */
    CheckResult preliminaryCredit(JxCreditDTO jxCreditDTO);

    /**
     * 填充ipc信息接口
     *
     * @param productId
     * @param customerId
     * @return
     */
    CheckResult customerIPC(String productId, String customerId);

    /**
     * 查询授信结果
     *
     * @param creditDTO
     * @return
     */
    JxModelResultVO backModelResult(JxSeCreditDTO creditDTO);

    /**
     * 预授信进件申请
     *
     * @param applicationVo
     * @param customerCredit
     * @param agentOrderId
     * @return
     */
    CheckResult submitCreditApplication(ApplicationVo applicationVo, CustomerCredit customerCredit, String agentOrderId);

    /**
     * 进件申请
     *
     * @param applicationVo
     * @param agentOrderId
     * @return
     */
    CheckResult submitJxApplication(ApplicationVo applicationVo, String agentOrderId);

    /**
     * 贷款请求信息
     *
     * @param jxLoanDTO
     * @return
     */
    CheckResult applyApplication(JxLoanDTO jxLoanDTO);

    /**
     * 查询放款结果
     *
     * @param applicationId
     * @return
     */
    CheckResult backLoanResult(String applicationId);

    /**
     * 根据身份证查询进件信息
     *
     * @param jxSeCreditDTO
     * @return
     */
    CheckResult queryAppIdByCardId(JxSeCreditDTO jxSeCreditDTO);

    /**
     * 插入极鲜影像信息
     *
     * @param jxAvInfoDTO
     * @return
     */
    String insertCustomerAV(String customerId, JxAvInfoDTO jxAvInfoDTO);

    /**
     * 新建产品
     *
     * @param product
     * @param file
     */
    CheckResult insertProduct(Product product, MultipartFile[] file);

    /**
     * 订单确认状态通知
     *
     * @param applicationStateDTO
     */
    CheckResult queryLoanResult(JxApplicationStateDTO applicationStateDTO);

    /**
     * 根据身份证或登录名查询进件id
     *
     * @param cardId
     * @param userId
     * @param agentId
     * @return
     */
    CheckResult queryAppIdByCardOrUserId(String cardId, String userId, String agentId);

    /**
     * 线下预授信申请接口
     *
     * @param jxCreditDTO
     * @param creditAmount
     * @param customerCredit
     * @return
     */
    CheckResult offlineCreditApplication(JxCreditDTO jxCreditDTO, BigDecimal creditAmount, CustomerCredit customerCredit);
}
